from sqlalchemy import Column, Integer, String
from sqlalchemy.ext.declarative import declarative_base

# 1. 生成模型基类
Base = declarative_base()


# 2. 创建数据表对应的类
class DownloadHistory(Base):
    # 对应MySQL中数据表的名字
    __tablename__ = 'download_history'

    # 创建字段
    id = Column(Integer, primary_key=True)  # 主键
    url = Column(String(200), nullable=False)  # 字段
    video_title = Column(String(200))  # 字段
